import React, { Suspense, lazy } from "react";
// 引入PatientCircle组件
const PatientCircle = lazy(() => import("../pages/PatientCircle"));
// 引入Comments组件
const Comments = lazy(() => import("../pages/Comments"));
// 引入My组件
const My = lazy(() => import("../pages/My"));
const Login = lazy(() => import("../pages/Login"));
const PasswordOne = lazy(() => import("../pages/PasswordOne"));
const PasswordTwo = lazy(() => import("../pages/PasswordTwo"));
const Register = lazy(() => import("../pages/Register"));
const Email = lazy(() => import("../pages/Email"));
const MyArchives = lazy(() => import("../pages/Myarchives"));
const MyarchiesInput = lazy(() => import("../pages/MyarchiesInput"));
const MyarchivesEdit = lazy(() => import("../pages/MyarchivesEdit"));
const Myconcern = lazy(() => import("../pages/Myconcern"));
const Mytask = lazy(() => import("../pages/Mytask"));
const Text = lazy(() => import("../pages/text"));
const Myssage = lazy(() => import("../pages/Myssage"));
const Systemmessages = lazy(() => import("../pages/Systemmessages"));
const Consultationmessage = lazy(() => import("../pages/Consultationmessage"));
const Hcoincreditingmessage = lazy(
  () => import("../pages/Hcoincreditingmessage")
);
const Commity_home = lazy(() => import("pages/Commity_Home"));
const Commity_detail = lazy(() => import("pages/Commity_Detail"));
const Commity_user = lazy(() => import("pages/Commity_User"));
const Commity_rate = lazy(() => import("pages/Commity_Rate"));
const Commity_search = lazy(() => import("pages/Commity_Search"));

const routes: { path: string; name: string; element: React.ReactNode }[] = [
  // 我的病友圈列表
  {
    path: "/patientCircle",
    name: "patientCircle",
    element: <PatientCircle />,
  },
  // 评论列表
  {
    path: "/comments",
    name: "comments",
    element: <Comments />,
  },
  //我的一级页
  {
    path: "/my",
    name: "my",
    element: <My />,
  },
  // 登录
  {
    path: "/login",
    name: "login",
    element: <Login />,
  },
  // 忘记密码
  {
    path: "/PasswordOne",
    name: "PasswordOne",
    element: <PasswordOne />,
  },
  // 修改密码
  {
    path: "/PasswordTwo",
    name: "PasswordTwo",
    element: <PasswordTwo />,
  },
  // 注册页面
  {
    path: "/Register",
    name: "Register",
    element: <Register />,
  },
  {
    path: "/Email",
    name: "Email",
    element: <Email />,
  },
  // 我的档案
  {
    path: "/MyArchives",
    name: "MyArchives",
    element: <MyArchives />,
  },
  // 我的档案
  {
    path: "/MyarchiesInput",
    name: "MyarchiesInput",
    element: <MyarchiesInput />,
  },
  // 我的档案
  {
    path: "/MyarchivesEdit",
    name: "MyarchivesEdit",
    element: <MyarchivesEdit />,
  },
  //我的关注
  {
    path: "/Myconcern",
    name: "Myconcern",
    element: <Myconcern />,
  },
  //我的任务
  {
    path: "/Mytask",
    name: "Mytask",
    element: <Mytask />,
  },
  // 获取数据
  {
    path: "/text",
    name: "text",
    element: <Text />,
  },
  // 我的消息
  {
    path: "/myssage",
    name: "myssage",
    element: <Myssage />,
  },
  //系统消息路由
  {
    path: "/Systemmessages",
    name: "Systemmessages",
    element: <Systemmessages />,
  },
  //问诊消息路由
  {
    path: "/Consultationmessage",
    name: "Consultationmessage",
    element: <Consultationmessage />,
  },
  // H币入账消息
  {
    path: "/Hcoincreditingmessage",
    name: "Hcoincreditingmessage",
    element: <Hcoincreditingmessage />,
  },
  {
    path: "/",
    name: "Home",
    element: <Commity_home />,
  },
  {
    path: "/detail",
    name: "Detail",
    element: <Commity_detail />,
  },
  {
    path: "/user",
    name: "User",
    element: <Commity_user />,
  },
  {
    path: "/rate",
    name: "Rate",
    element: <Commity_rate />,
  },
  {
    path: "/search",
    name: "搜索",
    element: <Commity_search />,
  },
];

// 导出路由
export default routes;
